/*
 * DistortionMoveThoughtDecorator.hpp
 *
 *  Created on: 09-01-2011
 *      Author: Piotr
 */

#pragma once

#include "AI/thoughts/MoveThought.hpp"
#include "geometry/Vector.hpp"
#include "pch.hpp"

/**
 * Changes given move by putting distortions in it
 */
class DistortionMoveThoughtDecorator: public Thought
{
	private:
		boost::shared_ptr<MoveThought> moveThought;
		float angleDistortionPercent;

	public:
		DistortionMoveThoughtDecorator(MoveThought *moveThought, float angleDistortionPercent);

		virtual void execute(Individual* individual);

	private:
		Vector getDistortionVector(const Vector& direction, Individual* individual);
		float getDistortionChange(const int maxPercentRange, const float maxChange) const;
};
